home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2001 / MacHack 2001.toast / pc / The Hacks / The Weakest Link / source / OpenTptEnet / CIncludes / poll.h < prev   
Encoding:
C/C++ Source or Header  |  2001-06-23  |  1.7 KB  |  65 lines

  1. /*
  2.     File:        poll.h
  3.  
  4.     Copyright:    © 1993-1997 by Mentat Inc., all rights reserved.
  5.  
  6. */
  7.  
  8. /** Copyright (c) 1993  Mentat Inc.                this line deleted for release disk
  9.  ** poll.h 4.1, last change 31 Aug 1993            this line deleted for release disk
  10.  **/                                            /* this line deleted for release disk */
  11.  
  12. #ifndef __POLL__
  13. #define __POLL__
  14. #define _POLL_                    /* this line deleted for release disk */
  15.  
  16. #ifndef __OPENTRANSPORT__
  17. #include <OpenTransport.h>
  18. #endif
  19.  
  20. #if PRAGMA_ALIGN_SUPPORTED
  21. #pragma options align=mac68k
  22. #endif
  23.  
  24. #define _MIPOLL_
  25.  
  26. #define NPOLLFILE        20
  27.  
  28. /* Poll masks */
  29. #define POLLIN            0x001    /* A non-priority message is available */
  30. #define POLLPRI         0x002    /* A high priority message is available */
  31. #define POLLOUT         0x004    /* The stream is writable for non-priority messages */
  32. #define POLLERR         0x008    /* A error message has arrived */
  33. #define POLLHUP         0x010    /* A hangup has occurred */
  34. #define POLLNVAL        0x020    /* This fd is bogus */
  35. #define POLLRDNORM        0x040    /* A non-priority message is available */
  36. #define POLLRDBAND        0x080    /* A priority message (band > 0) message is available */
  37. #define POLLWRNORM        0x100    /* Same as POLLOUT */
  38. #define POLLWRBAND        0x200    /* A priority band exists and is writable */
  39. #define POLLMSG         0x400    /* A signal message has reached the front of the queue */
  40.  
  41. #if SHAPIRO_OUT
  42. /* array of streams to poll */
  43. struct pollfd 
  44. {
  45.     int_t     fd;
  46.     short    events;
  47.     short    revents;
  48.     long    _ifd;            /* Internal "fd" for the benefit of the kernel */
  49. };
  50. #endif
  51.  
  52. /* I_POLL structure for ioctl */
  53. struct strpoll 
  54. {
  55.     unsigned long    nfds;
  56.     struct pollfd*    pollfdp;
  57.     int             timeout;        // shapiro: int_t -> int
  58. };
  59.  
  60. #if PRAGMA_ALIGN_SUPPORTED
  61. #pragma options align=reset
  62. #endif
  63.  
  64. #endif    /* _POLL_ */
  65.